$(function () {
    var k = getQueryString('keyword');
    if (k) {
        $('#global_policy_query').val(decodeURI(decodeURI(k)));
    }
    $('#global_query_btn').on('click', function () {
        var keyword = $('#global_policy_query').val();
        $(this).attr('href', contextPath + 'policy/index.html?page=10000&keyword=' + encodeURI(encodeURI(keyword)));
    })
})

var editor;

function createKE(selector,fileType) {
    KindEditor.ready(function (K) {
        editor = K.create(selector, {
            resizeType: 1,
            allowPreviewEmoticons: false,
            uploadJson: contextPath + 'file/upload.do?type='+fileType,
            allowImageUpload: true,
            pasteType: 2,      //设置粘贴；0（禁止粘贴），1（纯文本粘贴），2（HTML粘贴）
            items: [
                'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                'insertunorderedlist','insertfile', '|', 'emoticons', 'image', 'link','quickformat', 'fullscreen'],
            afterBlur: function () {
                this.sync();
            }
        });
    });
}
